{
target = frec->target;
win32_sel->property_change_transmute = frec->transmute;
+ win32_sel->property_change_target_atom = frec->target;
}
}
/* Delete dnd selection after successful move */
if (hr == DRAGDROP_S_DROP && dwEffect == DROPEFFECT_MOVE)
{
+ GdkWin32Selection *win32_sel = _gdk_win32_selection_get ();
GdkEvent tmp_event;
memset (&tmp_event, 0, sizeof (tmp_event));
tmp_event.selection.send_event = FALSE;
tmp_event.selection.selection = _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_OLE2_DND);
tmp_event.selection.target = _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_DELETE);
+ win32_sel->property_change_target_atom = _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_DELETE);
tmp_event.selection.property = _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_OLE2_DND);
g_set_object (&tmp_event.selection.requestor, drag_ctx->source_window);
tmp_event.selection.time = GDK_CURRENT_TIME; /* ??? */
win32_selection->dnd_data_object_target = NULL;
win32_selection->property_change_format = 0;
win32_selection->property_change_data = NULL;
+ win32_selection->property_change_target_atom = 0;
atoms = g_array_sized_new (FALSE, TRUE, sizeof (GdkAtom), GDK_WIN32_ATOM_INDEX_LAST);
g_array_set_size (atoms, GDK_WIN32_ATOM_INDEX_LAST);
tmp_event.selection.property = _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_GDK_SELECTION);
tmp_event.selection.requestor = owner;
tmp_event.selection.time = time;
+ win32_sel->property_change_target_atom = _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_TARGETS);
gdk_event_put (&tmp_event);
win32_sel->targets_request_pending = TRUE;
gint nelements)
{
if (property == _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_GDK_SELECTION) &&
- type == GDK_SELECTION_TYPE_ATOM) /* implies target == _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_TARGETS) */
+ win32_sel->property_change_target_atom == _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_TARGETS))
{
+ win32_sel->property_change_target_atom = 0;
+
if (win32_sel->clipboard_opened_for == INVALID_HANDLE_VALUE &&
OpenClipboard (GDK_WINDOW_HWND (window)))
{
open_clipboard_timeout (NULL);
}
}
+ else if (property == _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_OLE2_DND) &&
+ mode == GDK_PROP_MODE_REPLACE &&
+ win32_sel->property_change_target_atom == _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_DELETE))
+ {
+ /* no-op on Windows */
+ win32_sel->property_change_target_atom = 0;
+ }
else if (mode == GDK_PROP_MODE_REPLACE &&
- (win32_sel->property_change_data == NULL ||
+ (win32_sel->property_change_target_atom == 0 ||
+ win32_sel->property_change_data == NULL ||
win32_sel->property_change_format == 0))
{
- g_warning ("Setting selection property with 0x%p == NULL or 0x%x == 0", win32_sel->property_change_data, win32_sel->property_change_format);
+ g_warning ("Setting selection property with 0x%p == NULL or 0x%x == 0 or 0x%p == 0",
+ win32_sel->property_change_data,
+ win32_sel->property_change_format,
+ win32_sel->property_change_target_atom);
}
else if (mode == GDK_PROP_MODE_REPLACE &&
win32_sel->property_change_data != NULL &&
win32_sel->property_change_format = 0;
win32_sel->property_change_data = 0;
+ win32_sel->property_change_target_atom = 0;
}
else
{